package com.toKnow.model.vo;

import com.toKnow.model.entity.Article;
import com.toKnow.model.entity.Column;
import com.toKnow.model.entity.Tag;
import com.toKnow.model.entity.Type;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class ColumnVo {
    private List<ArticleAbstractVo> article_abstract=new ArrayList<>();
    private Integer author_id;
    private String author_name;
    private Date date;
    private List<String> type_list=new ArrayList<>();
    private List<String> tag_list=new ArrayList<>();
    private Integer read_times;
    private Integer like_times;
    private Integer collect_times;
    private Integer comment_times;
    private Boolean is_like;
    private Boolean is_collect;
    private Boolean is_Buy;

    public Boolean getIs_like() {
        return is_like;
    }

    public void setIs_like(Boolean is_like) {
        this.is_like = is_like;
    }

    public Boolean getIs_collect() {
        return is_collect;
    }

    public void setIs_collect(Boolean is_collect) {
        this.is_collect = is_collect;
    }

    public Boolean getIs_Buy() {
        return is_Buy;
    }

    public void setIs_Buy(Boolean is_Buy) {
        this.is_Buy = is_Buy;
    }

    @Override
    public String toString() {
        return "ColumnVo{" +
                "article_abstract=" + article_abstract +
                ", author_id=" + author_id +
                ", author_name='" + author_name + '\'' +
                ", date=" + date +
                ", type_list=" + type_list +
                ", tag_list=" + tag_list +
                ", read_times=" + read_times +
                ", like_times=" + like_times +
                ", collect_times=" + collect_times +
                ", comment_times=" + comment_times +
                '}';
    }

    public List<ArticleAbstractVo> getArticle_abstract() {
        return article_abstract;
    }

    public void setArticle_abstract(List<ArticleAbstractVo> article_abstract) {
        this.article_abstract = article_abstract;
    }

    public Integer getAuthor_id() {
        return author_id;
    }

    public void setAuthor_id(Integer author_id) {
        this.author_id = author_id;
    }

    public String getAuthor_name() {
        return author_name;
    }

    public void setAuthor_name(String author_name) {
        this.author_name = author_name;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public List<String> getType_list() {
        return type_list;
    }

    public void setType_list(List<String> type_list) {
        this.type_list = type_list;
    }

    public List<String> getTag_list() {
        return tag_list;
    }

    public void setTag_list(List<String> tag_list) {
        this.tag_list = tag_list;
    }

    public Integer getRead_times() {
        return read_times;
    }

    public void setRead_times(Integer read_times) {
        this.read_times = read_times;
    }

    public Integer getLike_times() {
        return like_times;
    }

    public void setLike_times(Integer like_times) {
        this.like_times = like_times;
    }

    public Integer getCollect_times() {
        return collect_times;
    }

    public void setCollect_times(Integer collect_times) {
        this.collect_times = collect_times;
    }

    public Integer getComment_times() {
        return comment_times;
    }

    public void setComment_times(Integer comment_times) {
        this.comment_times = comment_times;
    }

    public ColumnVo() {
    }

    public ColumnVo(List<ArticleAbstractVo> article_abstract, Integer author_id, String author_name, Date date, List<String> type_list, List<String> tag_list, Integer read_times, Integer like_times, Integer collect_times, Integer comment_times) {
        this.article_abstract = article_abstract;
        this.author_id = author_id;
        this.author_name = author_name;
        this.date = date;
        this.type_list = type_list;
        this.tag_list = tag_list;
        this.read_times = read_times;
        this.like_times = like_times;
        this.collect_times = collect_times;
        this.comment_times = comment_times;
    }

    public ColumnVo(Column column){
        this.author_id = column.getAuthorId();
        this.author_name = column.getAuthorName();
        this.date = column.getPublishDate();
        this.read_times = column.getReadNumber();
        this.like_times = column.getLikeNumber();
        this.collect_times = column.getCollectNumber();
        this.comment_times = column.getCommentNumber();
        for (Article article : column.getArticleIdList()){
            this.article_abstract.add(new ArticleAbstractVo(article));
        }
        for (Type type : column.getTypeList()){
            this.type_list.add(type.getName());
        }
        for (Tag tag : column.getTagList()){
            this.tag_list.add(tag.getName());
        }
    }
}
